using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using FriendsNearby.Services.Entities;
using InSTEDD.Labs.Geo;
using FriendsNearby.Services.Tests.Mocks;
using FriendsNearby.Services.Facebook;
using Facebook.Service;

namespace FriendsNearby.Services.Tests
{
    [TestFixture]
    public class NewFriendNearbyStrategyFixture
    {
        [Test]
        public void NewFriendDetected()
        {
            List<PersonNearby> before = new List<PersonNearby>();
            List<PersonNearby> now = new List<PersonNearby>();

            before.Add(new PersonNearby(){FacebookUserID = "A"});
            before.Add(new PersonNearby() { FacebookUserID = "B" });

            now.Add(new PersonNearby() { FacebookUserID = "A" });
            now.Add(new PersonNearby() { FacebookUserID = "C" , DisplayName="C name" });


            IEnumerable<string> newNearbies = NewFriendNearbyStrategy.GetNewFriendsNearby(before, now);

            Assert.IsNotNull(newNearbies);

            var it = newNearbies.GetEnumerator();

            Assert.IsTrue(it.MoveNext());
            Assert.AreEqual("C name", it.Current);
        }
    }

}
